1. Field of the Invention
The present invention generally relates to software updating of a baud divisor of an asynchronous serial port, and more particularly to predictable updating of a baud divisor of an asynchronous serial port during data reception.
2. Description of the Related Art
A typical feature of an embedded microcontroller has been a universal asynchronous receiver/transmitter (UART) for providing asynchronous serial communication. Certain microcontrollers with UART support have utilized automatic baud detection (also known as autobauding) in determining a baud rate for data to and from asynchronous serial ports. A baud rate is the rate at which data is sent and received over an asynchronous serial link by a microcontroller. The baud rate must be predetermined or determined through autobauding and independently controlled on both the sending and receiving ends. The standard baud rates in the industry have included 1200, 2400, 4800, 9600, 19.2K, 28.8K, 33.3K, 54K, and 115K data transfer rates. Asynchronous serial communication is commonly used for transferring data to and from memory, or across a bridge from one data bus or device to another. When data is transferred from one bus or device to another, synchronization can be very difficult. Accurately determining a baud rate is therefore important to ensuring successful transmission and reception of data by a microcontroller without data corruption.
The baud rate is a function of a baud divisor. For a UART, a baud clock frequency is typically divided by the baud divisor and multiplied by a certain factor to obtain the baud rate. To state another way, the baud divisor is calculated by dividing a clock frequency by some multiple of the baud rate. A baud divisor register is typically used for storing the baud divisor, and a baud count register or counter is typically used for storing a baud count loaded from the baud divisor register. Both registers are used during data reception. As such, the baud count register may require a reload at any time relative to a write to the baud divisor register.
With automatic baud detection, a baud divisor (which is determined in hardware) may vary slightly from the actual baud divisor value due to a variety of system issues. In some systems where there is a limited number of possible legitimate baud divisor values, software can determine the actual baud divisor value. An update or modification of the baud divisor during data reception however may result in unpredictable behavior, particularly since the behavior of a sending device is often not within the control of designers of the receiving device. Because of this significant possibility of unpredictable behavior, many UARTs have not allowed modification of a baud divisor during data reception.